/*
 * GraphRect.java
 *
 * Created on 28. maaliskuuta 2007, 16:48
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package flowchart.nodes;

import java.awt.*;

/**
 *
 * @author jl
 */
public class GraphicsRect extends AbstractGraphicsObject {
    
    /** Creates a new instance of GraphRect */
    public GraphicsRect(Rectangle r) {
        setBounds((Rectangle) r.clone());
    }
    
    public GraphicsRect(int x, int y, int w, int h) {
        this(new Rectangle(x, y, w, h));
    }
    
    public void draw(Graphics2D g) {
        if (bgColor != null) {
            Color old = g.getColor();
            g.setColor(bgColor);
            g.fill(bounds);
            g.setColor(old);
        }
        g.draw(bounds);
    }
    
}
